<?php

class Application_Form_NewArticle extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	$this->setName("newArticle");
    	$title=new Zend_Form_Element_Text('article_title');
    	$title->setLabel("文章标题")
    		  ->setRequired(true)
    		  ->addFilter('StripTags')
    		  ->addFilter('StringTrim')
    		  ->addValidator('NotEmpty')
    		  ->addValidator('StringLength',false,array(0,30,'UTF-8'));
    	$url_spell=new Zend_Form_Element_Text('article_url_spell');
    	$url_spell->setLabel("url拼音")
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,100,'UTF-8'));
    	$key_words=new Zend_Form_Element_Text('article_key_words');
    	$key_words->setLabel("关键词")
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,50,'UTF-8'));
    	$description=new Zend_Form_Element_Text('article_description');
    	$description->setLabel("概要描述")
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,120,'UTF-8'));
    	$content=new Zend_Form_Element_Textarea('article_content');
    	$content->setLabel("文章内容");
    	$type=new Zend_Form_Element_Radio('article_type');
    	$type->setLabel("文章类型")
    	     ->setMultiOptions(array('0' => "原创", '1' => '编辑','2'=>'转载'))
    	     ->setValue('0');
    	$type->setSeparator("");    
    	$content_type=new Zend_Form_Element_Radio('article_content_type');
    	$content_type->setLabel("文章内容分类")
    				 ->setMultiOptions(array('0'=>"新闻",'1'=>'文摘','2'=>'知识'))
    				 ->setValue('0');
    	$content_type->setSeparator("");
    	$from=new Zend_Form_Element_Text('article_from');
    	$from->setLabel("文章来源")
    	     ->addFilter('StripTags')
    		 ->addFilter('StringTrim')
    		 ->addValidator('StringLength',false,array(0,200));
    	     
    	$submit=new Zend_Form_Element_Submit("提交");
    	$this->addElements(array($title,$url_spell,$key_words,$description,$content,$type,$content_type,$from,$submit));
    }


}

